package com.ruoyi.aiConversation.mapper;

import java.util.Date;
import java.util.List;
import com.ruoyi.aiConversation.domain.AiConversation;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * ai对话Mapper接口
 * 
 * @author ruoyi
 * @date 2025-02-11
 */
public interface AiConversationMapper 
{
    /**
     * 查询ai对话
     * 
     * @param aiConversationId ai对话主键
     * @return ai对话
     */
    public AiConversation selectAiConversationByAiConversationId(String aiConversationId);



    /**
     * 查询ai对话列表
     * 
     * @param aiConversation ai对话
     * @return ai对话集合
     */
    public List<AiConversation> selectAiConversationList(AiConversation aiConversation);

    /**
     * 新增ai对话
     * 
     * @param aiConversation ai对话
     * @return 结果
     */
    @Insert("insert into ai_conversation(ai_conversation_id, user_id, start_time) values " +
            "(#{aiConversation.aiConversationId}, #{aiConversation.userId}, #{aiConversation.startTime})")
    public int insertAiConversation(@Param("aiConversation") AiConversation aiConversation);

    /**
     * 修改ai对话
     * 
     * @param aiConversation ai对话
     * @return 结果
     */
    public int updateAiConversation(AiConversation aiConversation);

    /**
     * 删除ai对话
     * 
     * @param aiConversationId ai对话主键
     * @return 结果
     */
    public int deleteAiConversationByAiConversationId(String aiConversationId);

    /**
     * 批量删除ai对话
     * 
     * @param aiConversationIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteAiConversationByAiConversationIds(String[] aiConversationIds);

    /**
     * 查询对话title
     * @param aiConversationId
     * @return
     */
//    @Select("select title from ai_conversation " +
//            "where ai_conversation_id=#{aiConversationId}")
//    String selectTitleByAiConversation(@Param("aiConversationId")String aiConversationId);
//
//    @Select("select ai_conversation_id from ai_conversation " +
//            "where user_id = #{userId} and start_time = #{currentDate}")
//    String selectAiConversationId(@Param("userId") Long userId,@Param("currentDate") Date currentDate);
}
